package gui;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.state.StateBasedGame;

import wiimote.WiimoteLink;

import constantes.Constantes;


public class SlickCastleDefense extends StateBasedGame {

	public static final int MAINMENUSTATE=0;
	public static final int GAMEPLAYSTATE=1;
	public static final int OPTIONSSTATE=2;
	public static final int DIFFICULTSTATE = 4;
	public static final int RESOLUTIONSTATE = 3;

	public SlickCastleDefense()
	{
		super("Polytech Nice Sophia DeVINT 2012 - Castle Defense");

		this.addState(new MainMenuState(MAINMENUSTATE));
		this.addState(new BuildIt(GAMEPLAYSTATE));
		this.addState(new Options(OPTIONSSTATE));
		this.addState(new Resolution(RESOLUTIONSTATE));
		this.addState(new Difficulte(DIFFICULTSTATE));
		this.enterState(MAINMENUSTATE);
	}

	public static void main(String[] args) throws SlickException
	{
		try{
			WiimoteLink.connect();
		}
		catch (Exception e){
			
		}
		AppGameContainer app = new AppGameContainer(new SlickCastleDefense());
		app.setShowFPS(Constantes.showFPSonScreen);
		app.setDisplayMode(Constantes.resolutionX, Constantes.resolutionY, Constantes.fullScreen);
		app.start();
	}

	@Override
	public void initStatesList(GameContainer gameContainer) throws SlickException {

		this.getState(MAINMENUSTATE).init(gameContainer, this);
		this.getState(GAMEPLAYSTATE).init(gameContainer, this);
		this.getState(OPTIONSSTATE).init(gameContainer, this);
		this.getState(RESOLUTIONSTATE).init(gameContainer, this);
		this.getState(DIFFICULTSTATE).init(gameContainer, this);
	}



}
